<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
		<title>全局配置-新增</title>
		<script type="text/javascript" src="../../commonFragment/header.js"></script>
		<script type="text/javascript" src="../../commonFragment/nojs.header.js"></script>
	</head>
	<body>
		<div class="container-fluid p-t-15">
			<div class="row">
				<div class="col-lg-12">
					<div class="card">
						<div class="card-body">
							<form class="form-horizontal validate" role="form vue-form" method="post" action="/blog/globalConfig/save"
							 data-form-url="/blog/globalConfig/detail">
								<div class="form-group hide">
									<label for="parentId" class="col-sm-2 control-label">隐藏的*</label>
									<div class="col-sm-8 ">
										<input type="text" id="id" name="id" :value="id" />
									</div>
									<div class="col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="code" class="col-sm-2 control-label">配置code*</label>
									<div class="col-sm-8 ">
										<input type="text" class="form-control" id="code" name="code" :value="code" data-rule-required="true"
										 placeholder="请输入配置code" autocomplete="off" readonly="readonly"/>
									</div>
									<div class="col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="name" class="col-sm-2 control-label">配置名称*</label>
									<div class="col-sm-8 ">
										<input type="text" class="form-control" id="name" name="name" :value="name" data-rule-required="true"
										 placeholder="请输入配置名称" autocomplete="off" readonly="readonly"/>
									</div>
									<div class="col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group hidden">
									<label for="showType" class="col-sm-2 control-label">展示类型:*</label>
									<div class="col-sm-8 ">
										<input type="text" class="form-control" id="showType" name="showType" :value="showType" data-rule-required="true"
										 placeholder="展示类型:1-input;2-textarea;3-图片;4-富文本" autocomplete="off" />
									</div>
									<div class="col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="content" class="col-sm-2 control-label">内容*</label>
									<div class="col-sm-8" id="contentDiv" style="display: none;">
										<!-- input -->
										<input type="text"  data-show-type="1" class="form-control" id="content" name="content" :value="content" data-rule-required="true"
										 placeholder="请输入内容" autocomplete="off" /> 
										 
										 <!--textarea -->
										 <textarea class="form-control"   data-show-type="2" rows="3" id="content" name="content" :value="content" data-rule-required="true"
										 placeholder="请输入分类介绍" autocomplete="off"></textarea>
										 <!-- 图片-->
										 <input type="hidden"   data-show-type="3"  name="content" :value="content" data-rule-required="true" />
										 <input type="file"   data-show-type="3" class="fileupload" data-preview="true" data-rule-accept="image/*" data-use-url="true" data-display-id="content" />
										 
										 <!-- 富文本-->
										<textarea class="form-control wangEditor-textarea"   data-show-type="4"  rows="3"  id="content" name="content" :value="content" data-rule-required="true"
										 placeholder="请输入分类介绍" autocomplete="off"></textarea>
									</div>
									<div class="col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="parentId" class="col-sm-2 control-label">状态*</label>
									<div class="col-sm-8 ">
										<select class="form-control" id="enable" name="enable" :data-value="enable" :value="enable"
										 data-rule-required="true">
											<option value="true">启用</option>
											<option value="false">禁用</option>
										</select>
									</div>
									<div class="col-sm-2  help-inline form-control-static"></div>
								</div>

								<div class="form-group clearfix">
									<div class="col-sm-offset-3 col-sm-9">
										<button type="button" class="btn btn-primary action-ajax-form">
											<i class="glyphicon glyphicon-ok"></i> 提交
										</button>
										<button type="button" class="btn btn-info action-close-tab">
											<i class="glyphicon glyphicon-repeat"></i> 返回
										</button>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script>
			$nojs.before(function(context){
				//先加载form数据
				$nojs.loadVueForm.init(context);
				$nojs.loadVueForm.enable = false;
				//根据showType  展示不同的区域
				$('[data-show-type!="'+$("#showType").val()+'"]',$("#contentDiv")).remove().end().show();
			});
		</script>
	</body>
</html>
